import mongoose from "mongoose";

const schema = new mongoose.Schema({
    title:{
        type:String,
        required:true,
    },
    typeId:{
        type:String,
        required:true
    },
    content:String,
    userId:{
        type:String,
        required:true
    },
    pv:{
        type:Number,
        default:0,
    },
},{ 
    //用于自动生成创建时间
    timestamps:true
})

export const articleModel = mongoose.model("articles",schema);